<?php

if ( post_password_required() ) : ?>
<p><?php _e('Enter your password to view comments.'); ?></p>
<?php return; endif; ?>

<h3 id="comments"><?php comments_number(__('Schreibe einen Kommentar zu'), __('Ein Kommentar zu'), __('% Kommentare zu'));?> "<?php the_title(); ?>"</h3>
<?php if ( have_comments() ) : ?>

<div id="commentlist">

<?php foreach ($comments as $comment) : ?>
	<div class="author">
		<div class="avatars">
			<?php echo get_avatar( $comment, 60 ); ?>
		</div>
		<div class="article_comment">
			<?php comment_author_link() ?>
			<div class="comment_bubble">
				<?php comment_text() ?>
			</div>
		</div>
		<div class="clear"></div>
	</div>

<?php endforeach; ?>

</div>
<div class="clear"></div>
<?php else : // If there are no comments yet ?>
<?php endif; ?>

<?php if ( comments_open() ) : ?>
<?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?>
<p><?php printf(__('Du musst <a href="%s">eingeloggt</a> sein um zu kommentieren.'), wp_login_url( get_permalink() ) );?></p>
<?php else : ?>
<h3>Deine Meinung:</h3>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">

<?php if ( is_user_logged_in() ) : ?>

<p><?php printf(__('Hallo %s.'), '<a href="'.get_option('siteurl').'/wp-admin/profile.php">'.$user_identity.'</a>'); ?> <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="<?php _e('Logout') ?>"><?php _e('Logout &raquo;'); ?></a></p>

<?php else : ?>
<a name="postcomment"></a>
<p><input type="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" size="22" tabindex="1" />
<label for="author"><small><?php _e('Name'); ?> <?php if ($req) _e('(Pflicht)'); ?></small></label></p>

<p><input type="text" name="email" id="email" value="<?php echo esc_attr($comment_author_email); ?>" size="22" tabindex="2" />
<label for="email"><small><?php _e('E-Mail');?> <?php if ($req) _e('(Pflicht)'); ?></small></label></p>

<p><input type="text" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" size="22" tabindex="3" />
<label for="url"><small><?php _e('Website'); ?></small></label></p>

<?php endif; ?>

<p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>

<p><input name="submit" type="submit" id="submit" tabindex="5" value="Kommentar abschicken" />
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
</p>
<?php do_action('comment_form', $post->ID); ?>

</form>

<?php endif; // If registration required and not logged in ?>

<?php else : // Comments are closed ?>
<p><?php _e('Sorry, the comment form is closed at this time.'); ?></p>
<?php endif; ?>